import Vue from 'vue'
import Router from 'vue-router'

const Home = () => import('@/views/home/vHome')
const Login = () => import('@/views/vLogin')
const User = () => import('@/views/home/children/vUser')
const UserEdit = () => import('@/views/home/children/vUserEdit')
const UserAdd = () => import('@/views/home/children/vUserAdd')
const Management = () => import('@/views/home/children/vManagement')

Vue.use(Router)
const routes = [
  {path: '/home', component: Home, children: [
      {path: '', redirect: 'user'},
      {path: 'user', component: User},
      {path: 'edit', component: UserEdit},
      {path: 'useradd', component: UserAdd},
      {path: 'management', component: Management},

  ]},
  {path: '/login', component: Login},
  {
    path:'/',
    redirect: '/home'
  }

]
export default new Router({
  routes
})
